package com.lxw.mq;

import com.lxw.config.RabbitConfig;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer_topics_sms_boot {

    @RabbitListener(queues = {RabbitConfig.QUEUE_SMS})
    public void receive_sms(String msg, Message message, Channel channel){
        System.out.println("receive_sms :"+msg);
    }

//    @Autowired
//    private  RabbitTemplate rabbitTemplate;
//
//    @Test
//    public void sendMessage(){
//        String message = "hello world!";
//        rabbitTemplate.convertAndSend(RabbitConfig.EXCHANGE_TOPIC,"routing.sms",message);
//    }
}
